<!DOCTYPE html>
<html>
<head>
	<title>留言</title>
	<meta name="viewport" charset="utf-8" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<link rel="stylesheet" type="text/css" href="/css/pages/user/public.css">
	<link rel="stylesheet" type="text/css" href="/css/pages/user/doctor/message.css">
	<script type="text/javascript" src="/lib/js/jquery-1.11.2.min.js"></script>
	<script type="text/javascript" src="/js/pages/user/doctor/message.js"></script>
</head>
<body>
	<div class="doctor_desc">
		<div class="top_desc">
			<div class="headimg_div">
				<img src="{{ $doctor['headimg'] }}">
			</div>
			<div class="desc_div">
				<input type="hidden" id="doctor_id" name="" value="{{ $doctor['id'] }}">
				<div class="rol_div">
					<div class="name">
						{{ $doctor['name'] }}
					</div>
					<div class="job_title">
						{{ $doctor['job_title'] }}
					</div>
				</div>
				
				<div class="hospital">
					{{ $doctor['hospital'] }}
				</div>
				<div class="section">
					{{ $doctor['section'] }}
				</div>
			</div>
		</div>
		<div class="resume_div">
			{{ $doctor['resume'] }}
		</div>
		<div class="message_div">
			<div class="message_title">
				留言区
			</div>
			<div class="message_list">
				<ul class="message_ul">
					@foreach($doctor['messages'] as $message)
					<li class="message_li">
						<input type="hidden" id="this_message_id" name="" value="{{ $message['id'] }}">
						<div class="headimg_div">
							<img src="{{ $message['wechatUser']['headimgurl'] }}">
						</div>
						<div class="nickname_time_div">
							<div class="nickname">
								{{ $message['wechatUser']['nickname'] }}
							</div>
							<div class="time">
								{{ $message['created_at'] }}
							</div>
						</div>
						<div class="message_content">
							{{ $message['content' ]}}
						</div>
						<ul class="reply_ul">
							@foreach($message['replys'] as $reply)
							<li class="reply_li">
								<div class="reply_title">
									<div class="doctor_reply">
										{{ $reply['reply_type' ] == 1?"医生回复":"用户回复" }}
									</div>
									<div class="reply_time">
										{{ $reply['created_at'] }}
									</div>
								</div>
								<div class="reply_content">
									{{ $reply['reply_content' ] }}
								</div>
							</li>
							@endforeach
						</ul>
						@if($message['wechatUser']['openid'] == $user->getId())
						<div class="reply_btn reply_this_btn">回复</div>
						@endif
					</li>
					@endforeach
				</ul>
			</div>
		</div>
		<div class="message_clean"></div>
		@if($isMessage)
		<div class="message_input">
			<input  id="content" type="text" name="">
			<div id="message_btn" class="send_btn">
				留言
			</div>
		</div>
		@endif
		<div id="reply_div"  class="message_input" style="display: none;">
			<input type="hidden" id="message_id" name="">
			<input type="text" id="reply_content" name="">
			<div id="reply_btn" class="send_btn">
				回复
			</div>
		</div>
	</div>
</body>
</html>